<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
    <style>
        li {
            overflow: hidden;
            padding: 10px;
        }
        
        li img {
            width: 100px;
            float: left;
        }
    </style>
</head>

<body>
    <div id="app">
        <button @click="handleClick">click</button>
        <ul>
            <li v-for="item of datalist" :key="item.id">
                <img :src="item.img" alt="">
                <div>
                    {{item.nm}}
                </div>
                <div>评分：{{item.mk}}</div>
                <div>{{item.desc}}</div>
                <div>{{item.showInfo}}</div>
            </li>
        </ul>
    </div>
    <script>
        var obj = {
            data() {
                return {
                    datalist: []
                }
            },
            methods: {
                handleClick() {

                    fetch('test.json').then(res => res.json()).then(res => {
                        // console.log(res.data.hot)
                        this.datalist = res.data.hot
                    })
                }
            }
        }

        var app = Vue.createApp(obj).mount('#app')
    </script>
</body>

</html>